#@head() 
#@header()
<title>客户列表</title>
#@aside("auxiliary") 
<script type="text/javascript" src="#(path)/assets/js/jquery.tmpl.min.js"></script>
<style>
	.box-body{padding:5px !important}
</style>
<div class="content-wrapper">
	<section class="content">
	<div class="nav-tabs-custom">
		<ul class="nav nav-tabs">
		  <li class="active" ><a href="#(path)/admin/page/auxiliary-custominfo" style="cursor:pointer" >查看信息</a></li>
		</ul>
		<div class="tab-content">
		  <div class="tab-pane active" id="tab_1">
			<div class="box-body">
			<table id="example1" class="table table-bordered table-striped dataTable col-md-8" role="grid" aria-describedby="example1_info">
				<tbody>
				<tr role="row" class="odd">
				  <td align="right" style="width:130px;" class="sorting_1">用户姓名：</td>
				  <td id="realName" class="sorting_1"></td>
				</tr>
				<tr role="row" class="even">
				  <td align="right" style="width:130px;" class="sorting_1">手机号：</td>
				  <td id="mobile" class="sorting_1"></td>
				</tr>
				<tr role="row" class="odd">
				  <td align="right" style="width:130px;" class="sorting_1">工号：</td>
				  <td id="workcode" class="sorting_1"></td>
				</tr>
				<tr role="row" class="even">
				  <td align="right" style="width:130px;" class="sorting_1">角色：</td>
				  <td id="role" class="sorting_1"></td>
				</tr>
				<tr role="row" class="odd">
				  <td align="right" style="width:130px;" class="sorting_1">所属上级</td>
				  <td id="leader" class="sorting_1"></td>
				</tr>
				<tr id="zubie" role="row" class="odd">
				  <td align="right" style="width:130px;" class="sorting_1">客服组别</td>
				  <td id="groups" class="sorting_1"></td>
				</tr>
				<tr id="yeji" role="row" class="odd">
				  <td align="right" style="width:130px;" class="sorting_1">当月业绩（万元）</td>
				  <td id="target" class="sorting_1"></td>
				</tr>
				<tr role="row" class="odd">
				  <td align="right" style="width:130px;" class="sorting_1">添加时间</td>
				  <td id="create_time" class="sorting_1"></td>
				</tr>
				<tr role="row" class="odd">
				  <td align="right" style="width:130px;" class="sorting_1">修改时间</td>
				  <td id="modify_time" class="sorting_1"></td>
				</tr>
				</tbody>
			</table>
			</div>
		</div>
	</div>  
	<div  style="margin-left:20px;padding-bottom:20px;">
		<div id="caozuo" class="btn-group-vertical">
		  <button onclick="#(path)/admin/page/auxiliary-addcustom" type="button" class="btn btn-info">修改</button>
		</div>
	</div>
	</section>
</div>
#@footer()
<script>
$(document).ready(function(){
	var id = GetRequest(id).id;
	$.getJSON("/staff/info?token=#(session.token??)&id="+id, function(agentinfo) {
		console.log(agentinfo);
		$("#realName").html(agentinfo.data.real_name);
		$("#userdd").html(agentinfo.data.user_id);
		$("#mobile").html(agentinfo.data.mobile);
		$("#workcode").html(agentinfo.data.workcode);
		var role= agentinfo.data.role;
		if(role=="admin"){
			role ="管理员";
			$("#zubie").remove();
			$("#yeji").remove();
		}else if(role=="agent"){
			role ="普通客服";
		}else if(role=="agent_leader"){
			role ="客服组长";
		}else if(role=="agent_manager"){
			role ="客服主管";
			$("#zubie").remove();
			$("#yeji").remove();
		}else if(role=="assets_create"){
			role ="资产发布";
			$("#zubie").remove();
			$("#yeji").remove();
		}else if(role=="assets_first"){
			role ="资产一审";
			$("#zubie").remove();
			$("#yeji").remove();
		}else if(role=="assets_second"){
			role ="资产终审";
			$("#zubie").remove();
			$("#yeji").remove();
		}else if(role=="product"){
			role ="营销管理"; 
			$("#zubie").remove();
			$("#yeji").remove();
		}else if(role=="active"){
			role ="活动管理"; 
			$("#zubie").remove();
			$("#yeji").remove();
		}
		
		$("#role").html(role);
		$("#target").html(agentinfo.data.target);
		$("#groups").html(agentinfo.data.groups);
		$("#leader").html(agentinfo.data.leaderName);
		$("#create_time").html(agentinfo.data.create_time);
		$("#modify_time").html(agentinfo.data.update_time);	
	});
	
	//菜单
	function GetRequest() {  
	   var url = location.search; //获取url中"?"符后的字串  
	   var theRequest = new Object();  
	   if (url.indexOf("?") != -1) {  
		  var str = url.substr(1);  
		  strs = str.split("&");  
		  for(var i = 0; i < strs.length; i ++) {  
			 theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);  
		  }  
	   }  
	   return theRequest;  
	} 
});


</script>
</body>
</html>